/*
 * @Author: shaohh 
 * @Date: 2022-11-03 10:38:54 
 * @Last Modified by: shaohh
 * @Last Modified time: 2022-11-08 17:34:10
 */
<template>
    <el-dialog :title="title" :visible.sync="dialogVisible" :append-to-body="true" width="30%" class="delete_dialog">
        <span slot="title">{{title}}</span>
        <slot/>
        <span slot="footer" class="dialog-footer">
            <el-button @click="dialogVisible = false">取 消</el-button>
            <el-button type="primary" @click="submit">确 定</el-button>
        </span>
    </el-dialog>
</template>
    
<script>
import _ from 'lodash'
export default {
    name: "deleteDialog",
    components: {},
    data() {
        return {
            dialogVisible:false,
            cb:null,
        }
    },
    props:{
        title:{
            type:String,
            default:()=>'删除'
        }
    },
    created() {
        
    },
    mounted() {

    },
    methods: {
        openDialog(cb){
            this.dialogVisible = true
            this.cb = cb
        },
        submit:_.debounce(function(){
            this.dialogVisible = false
            if(typeof this.cb === "function"){
                this.cb()
            }
        },1000,{leading:true,trailing:false})
    }
}
</script>
<style lang="less" scoped>
.delete_dialog{
    /deep/.el-dialog__header{
        border-bottom: 1px solid #dcdfe6;
    }
    /deep/ .el-dialog__body{
        padding-bottom: 15px;
    }
}

</style>